package common.splitpage;

import java.util.ArrayList;
import java.util.List;

public class ListPageImpl extends PageImpl implements Pageable {

	public ListPageImpl(PageInfo pageInfo) {
		super(pageInfo);
	}

	protected void gotoPage() {
		super.gotoPage();

		Object pageObj = pageInfo.getPageObject();
		List list = null;
		if (pageObj != null)
			list = (List) pageObj;

		List pageList = new ArrayList();
		if (list != null && !list.isEmpty()) {
			pageList = list.subList(this.startRow - 1, this.endRow);
		}
		this.pageInfo.setPageObject(pageList);
	}

	public static void main(String[] args) {
		
	}
}
